<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>review merchant's application</title>
<script type="text/javascript">
function selectType() {
	document.getElementById("udpateTypeForm").submit();
}
</script>
</head>

<body>
<a align = "left" href="LogoutServlet">logout</a>
<%-- table 显示被编辑的商家的信息 --%>
<h2>Update Merchant Status</h2> 
<table border="8">
	<tr>
		<td>id</td>
		<td>name</td>
		<td>image</td>
		<td>address</td>
		<td>type</td>
		<td>reason</td>
		<td>status</td>
	</tr>
	<%-- m 为Servlet传来的变量，表示当前被编辑的商家 --%>
	<tr>
		<td>${m.mId }</td>
		<td>${m.mName}</td>
		<td><img src="ImageServlet?mId=${m.mId}&pictureType=image" height="100px"  width="100px"/></td>
		<td><img src="ImageServlet?mId=${m.mId}&pictureType=idCard"/></td> 
		<td>${m.address }</td>
		<td>${m.type}</td>
		<td>${m.reason }</td>
		<td>${m.status }</td>		
	</tr>
</table>

<%--下拉框 更改商家状态 审核中 --> 审核通过 （状态是单向变更） --%>
	<form id="udpateTypeForm" action="ReviewServlet?mId=${m.mId }" method="post" >
		<h2>Change Review Status</h2>
		<select name="type" >
			<option value="ASSESSING" >ASSESSING </option>
			<option value="ASSESSED" >ASSESSED </option>
			<option value="REJECT" >REJECT </option>
		</select>
		<br/>
		<h2>Edit Review Reason</h2>
		<textarea name="reason" cols="80" rows="5"></textarea>  
		<input type="submit" value="submit" />
	</form>
</body>
</html>